home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / src / exampleCode / opengl / utilities / isfast / libisfast / visinfo.h < prev   
C/C++ Source or Header  |  1996-11-11  |  2KB  |  69 lines

  1. /*
  2.  * Copyright (c) 1994 Silicon Graphics, Inc.
  3.  * 
  4.  * Permission to use, copy, modify, distribute, and sell this software and
  5.  * its documentation for any purpose is hereby granted without fee,
  6.  * provided that (i) the above copyright notices and this permission
  7.  * notice appear in all copies of the software and related documentation,
  8.  * and (ii) the name of Silicon Graphics may not be used in any
  9.  * advertising or publicity relating to the software without the specific,
  10.  * prior written permission of Silicon Graphics.
  11.  * 
  12.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
  13.  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
  14.  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  15.  * 
  16.  * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL,
  17.  * INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
  18.  * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  19.  * OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
  20.  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  21.  * OF THIS SOFTWARE.
  22.  */
  23.  
  24. /*****************************************************************************
  25.  * visPixelFormat, visGetGLXVisualInfo - tools for choosing GLX Visuals
  26.  *
  27.  * Usage:
  28.  *
  29.  *    char* criteria;        // e.g. "max rgba, z >= 16, db"
  30.  *    XVisualInfo* vInfo;
  31.  *    int nVInfo;
  32.  *    Display* dpy;
  33.  *    int screen;
  34.  *    int i;
  35.  *
  36.  *    if (!visPixelFormat(criteria)) {
  37.  *        printf("syntax error in pixel format specification\n");
  38.  *        exit(1);
  39.  *        }
  40.  *    vInfo = visGetGLXVisualInfo(dpy, screen, &nVInfo);
  41.  *    for (i = 0; i < nVInfo; ++i)
  42.  *        DoSomethingWith(&vInfo[i]);
  43.  *    free(vInfo);
  44.  *****************************************************************************/
  45.  
  46. #ifndef __VISINFO_H__
  47. #define __VISINFO_H__
  48.  
  49.  
  50. #include <GL/glx.h>
  51.  
  52.  
  53. #ifdef __cplusplus
  54. extern "C" {
  55. #endif
  56.  
  57.  
  58.  
  59. XVisualInfo* visGetGLXVisualInfo(Display* dpy, int screen, int* nVInfo);
  60. int visPixelFormat(const char* criteria);
  61.  
  62.  
  63.  
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67.  
  68. #endif /* !__VISINFO_H__ */
  69.